﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using JulMar.Windows.Mvvm;
using System.Windows.Input;
using NathansMapInfoProjects.WindowManager.Models;

namespace NathansMapInfoProjects.WindowManager.ViewModels
{
    /// <summary>
    /// View model for a closed 
    /// </summary>
    public class ClosedWindowViewModel : ViewModel
    {
        public ClosedWindowViewModel(IClosedWindow window)
        {
            this.Window = window;

            this.Restore = new RelayCommand(obj => 
            {
                Entry.Session.Do(this.Window.RestoreString);
            });
        }

        public string Name
        {
            get
            { 
                return String.Format("{0} {1}",this.Window.WindowName,this.Window.CloseTime.ToLocalTime().ToLongTimeString());
            }
        }

        public IClosedWindow Window { get; set; }

        public ICommand Restore { get; private set; }
    }
}
